﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ScanStores.aspx.cs" Inherits="Locator.Admin.Views.ScanStores"
    Title="ScanStores" MasterPageFile="~/Shared/DefaultMaster.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="DefaultContent" runat="Server">
    <asp:ScriptManagerProxy runat="server" ID="Proxy">
        <Scripts>
            <asp:ScriptReference Path="~/Scripts/jquery.signalR.min.js" />
        </Scripts>
        <Services>
            <asp:ServiceReference Path="~/Admin/ScannerService.svc" />
        </Services>
    </asp:ScriptManagerProxy>
    <script type="text/javascript">
        $(function () {
            var connection = $.connection('/updates');

            connection.received(function (data) {
                $('#messages').append('<li>' + data + '</li>');
            });

            connection.start();

            $("#broadcast").click(function () {
                var service = new ScannerService();
                service.ScanStores();
            });
        });
    </script>
    <div class="row" id="content">
        <div class="column grid_12">
            <h1>
                Scan Stores</h1>
            <asp:Button ID="ScanButton" runat="server" Text="Scan" OnClick="ScanButton_Click" /><br />
            <br />
            <input type="button" id="broadcast" value="Broadcast" /><br />
            <ul id="messages">
            </ul>
            <br />
            <asp:TextBox ID="ResultsTextBox" runat="server" TextMode="MultiLine" Height="350"
                Width="500"></asp:TextBox>
        </div>
    </div>
</asp:Content>
